#pragma once
#include "afxwin.h"


// CAccountRecDlg dialog
class CVaxSIPUserAgent;

class CAccountRecDlg : public CPropertyPage
{
	DECLARE_DYNAMIC(CAccountRecDlg)

public:
	CAccountRecDlg(CVaxSIPUserAgent* pVaxSIPUserAgent);
	virtual ~CAccountRecDlg();

// Dialog Data
	enum { IDD = IDD_ACCOUNT_REC_DLG };

private:

	CVaxSIPUserAgent* m_pVaxSIPUserAgent;

	CFont m_objFont;

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:

	afx_msg void OnBnClickedBtnOnline();

	CButton m_ctrlInitBtn;
	
	CListBox m_ctrlStatusLogListBox;
	CListBox m_ctrlCallStatusLogListBox;

public:

	CString m_sAccountUserName;
	CString m_sAccountAuthName;
	CString m_sAccountDisplayName;
	CString m_sAccountPassword;
	CString m_sAccountDomainSIP;
	CString m_sAccountProxySIP;

	BOOL m_bCheckRegisterToProxy;

private:

	void AddToLog(CString sLog);
	void AddToCallLog(CString sLog);
		
public:

	afx_msg void OnBnClickedBtnStatusLogClear();
	afx_msg void OnBnClickedBtnCallLogClear();
	
	/////////////////////////////////////////////////////////////////////////////////////////

	void OnTryingToRegisterREC();
	void OnFailToRegisterREC(int nStatusCode, LPCTSTR sReasonPhrase);
	void OnSuccessToRegisterREC();

	void OnTryingToReRegisterREC();
	void OnFailToReRegisterREC(int nStatusCode, LPCTSTR sReasonPhrase);
	void OnSuccessToReRegisterREC();
	
	void OnTryingToUnRegisterREC();
	void OnFailToUnRegisterREC();
	void OnSuccessToUnRegisterREC();
		
	void OnServerConnectingREC(int nLineNo, int nStatusCode, LPCTSTR sReasonPhrase);
	void OnServerConnectedREC(int nLineNo);
	void OnServerFailedREC(int nLineNo, int nStatusCode, LPCTSTR sReasonPhrase);
	void OnServerHungupREC(int nLineNo);
	
	void OnStatusMsgREC(int nLineNo, DWORD dwErrorCode, CString sErrorMsg);
	
	
};
